Animation Helper
Provides utility methods for creating and running common View animations. This class simplifies tasks such as fading views in or out, and translating views to new positions on the screen.
Example usage for fading a view in:
View myView = findViewById(R.id.my_view);
AnimationHelper.fadeIn(myView, 500); // Fades in over 500 milliseconds
Content copied to clipboard
See also
Functions
Link copied to clipboard
Fades in the target View from fully transparent (alpha 0) to fully opaque (alpha 1) using the default duration of {@value #DEFAULT_FADE_DURATION} milliseconds.
open fun fadeIn(@NonNull target: View, duration: Long, @Nullable listener: Animator.AnimatorListener)
Fades in the target View from fully transparent (alpha 0) to fully opaque (alpha 1).
Link copied to clipboard
Fades out the target View from fully opaque (alpha 1) to fully transparent (alpha 0) using the default duration of {@value #DEFAULT_FADE_DURATION} milliseconds.
open fun fadeOut(@NonNull target: View, duration: Long, @Nullable listener: Animator.AnimatorListener)
Fades out the target View from fully opaque (alpha 1) to fully transparent (alpha 0).